#!/opt/homebrew/bin/python3.13

from abc import ABCMeta, abstractmethod


class Person:
    def __init__(self, name, age):
        self.name = name
        self.age = age

    def myfunc(self):
        print("Hello my name is " + self.name)
    def getName():
        return self.name
    def getAge():
        return self.age
    
    @classmethod
    def createPerson(cls,name,age):
        return Person(name,age)
    
    @staticmethod
    def getPersonName():
        return "Person"

p1 = Person("John", 36)
print(p1.name)
print(p1.age)
print(p1.myfunc())

p2 = Person.createPerson("John", 36)
print(p2.name)
print(p2.age)
print(p2.myfunc())
print(p2.getPersonName())


class Student(Person):
    def __init__(self, name, age, graduationyear):
        Person.__init__(self, name, age)
        self.graduationyear = graduationyear
    def welcome(self):
        print("Welcome", self.name, "to the class of", self.graduationyear)
    def getGraduationYear(self):
        return self.graduationyear
    def setGraduationYear(self,year):
        self.graduationyear = year

student = Student("John", 36, 2034)
print(student.getGraduationYear())

class Entity(metaclass=ABCMeta):
    
    @abstractmethod
    def get_title(self):
        pass

    @abstractmethod
    def set_title(self, title):
        pass

class Document(Entity):

    def get_title(self):
        return self.title

    def set_title(self, title):
        self.title = title


document = Document()
document.set_title("Harry Potter")
print(document.get_title())

























